{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Overview\n",
    "# （回顾）\n",
    "\n",
    "What you can accomplish with just Python has increased quite a bit in the last years as more sophisticated tools that plug in to the Jupyter widget ecosystem have been written.\n",
    "(在过去几年中，随着插入 Jupyter 小部件生态系统的更复杂的工具的编写，您可以仅使用 Python 完成的任务增加了很多。)\n",
    "\n",
    "One of those tools is [bqplot](https://github.com/bloomberg/bqplot/blob/master/examples/Index.ipynb), which provides a plotting tool in which the plot, and the lines, markers, labels and legend, all act as widgets. bqplot was developed using both Python *and* JavaScript. On the JavaScript side bqplot uses [d3](https://d3js.org/) to do the drawing in the browser. \n",
    "(其中一个工具是 bqplot，它提供了一个绘图工具，其中绘图以及线条、标记、标签和图例都充当小部件。bqplot 是使用 Python 和 JavaScript 开发的。在 JavaScript 方面，bqplot 使用 d3 在浏览器中进行绘图。)\n",
    "\n",
    "The widely-used plotting library [matplotlib](https://matplotlib.org/3.2.2/contents.html) also has a widget interface. Use `%matplotlib widget` in the notebook to have interactive plots that are widgets. Look at the documentation for [ipympl](https://github.com/matplotlib/ipympl) for more details on using it as a widget.\n",
    "(广泛使用的绘图库 matplotlib 也有一个小部件界面。在笔记本中使用 %matplotlib 小部件来获得作为小部件的交互式绘图。查看 ipympl 的文档，了解有关将其用作 widget 的更多详细信息。)\n",
    "\n",
    "Another example is [ipyvolume](https://ipyvolume.readthedocs.io/en/latest/), which does three-dimensional renderings of point or volumetric data in the browser. It has both Python and JavaScript pieces but using it requires only Python.\n",
    "(另一个例子是 ipyvolume，它可以在浏览器中对点或体积数据进行三维渲染。它同时具有 Python 和 JavaScript 部分，但使用它只需要 Python。)\n",
    "\n",
    "One last addition is in `ipywidgets` itself: the new `Output` widget can display any content which can be rendered in a Jupyter notebook. That means that anything you can show in a notebook you can include in a widget using only Python.\n",
    "(最后一个添加是在 ipywidgets 本身：新的 Output 小部件可以显示可以在 Jupyter 笔记本中呈现的任何内容。这意味着您可以在笔记本中显示的任何内容都可以仅使用 Python 包含在小组件中。)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1: COVID dashboard (pure Python)\n",
    "\n",
    "+ Dashboard: http://jupyter.mnstate.edu/COVID\n",
    "+ Code: https://github.com/JuanCab/COVID_DataViz (see `Dashboard.ipynb`)\n",
    "\n",
    "Orange boxes are [ipympl](); magenta box is [ipyleaflet](https://ipyleaflet.readthedocs.io/en/latest/); remaining widgets are from [ipywidgets](https://ipywidgets.readthedocs.io/en/stable/).\n",
    "\n",
    "|    |    |\n",
    "|----|----|\n",
    "![Screenshot of COVID dashboard](images/covid-dash1.png) | ![Screenshot of COVID dashboard map](images/covid-dash2.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2: Binary star simulation (pure Python)\n",
    "\n",
    "+ Green: [pythreejs](https://github.com/jupyter-widgets/pythreejs)\n",
    "+ Blue: [bqplot](https://github.com/bloomberg/bqplot/blob/master/examples/Index.ipynb)\n",
    "+ Everything else: [ipywidgets](https://github.com/jupyter-widgets/ipywidgets)\n",
    "+ Serving it up to users during development on [mybinder.org](https://mybinder.org/)\n",
    "\n",
    "![Binary Star Simulator](images/Binary_Star_Sim.png)\n",
    "\n",
    "### Source for this example (including links to binder): https://github.com/JuanCab/AstroInteractives\n",
    "\n",
    "[Video](https://youtu.be/kbgST0uifvM)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "widgets-tutorial",
   "language": "python",
   "name": "widgets-tutorial"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
